#pragma once

#include "../umlmodel_global.h"

#include <memory>
#include <vector>

#include "WriteLinkAction.h"

using std::make_shared;
using std::shared_ptr;
using std::vector;

namespace uml {
class LinkEndCreationData;

/// <summary>
/// CreateLinkAction
/// A CreateLinkAction is a WriteLinkAction for creating links.
/// </summary>
class UMLMODEL_EXPORT CreateLinkAction : public WriteLinkAction {

public: // Constructors and destructors
    explicit CreateLinkAction(const QString& umlType="uml::CreateLinkAction");

public: // JsonSerializable override
    void fromJson(const QJsonObject& json, QStringList& errorList) override;
    void toJson(QJsonObject& json) override;

public: // Properties
    /// <summary>
    /// endDatas getter
    /// The LinkEndData that specifies the values to be placed on the Association ends
    /// for the new link.
    /// </summary>
    vector<shared_ptr<LinkEndCreationData>>& endDatas();

private: // Fields
    /// <summary>
    /// endDatas
    /// The LinkEndData that specifies the values to be placed on the Association ends
    /// for the new link.
    /// </summary>
    vector<shared_ptr<LinkEndCreationData>> endDatas_;

};

} // namespace uml
